/*
 * $HeadURL: $
 * $Id: $
 * Copyright (c) 2011 by Ericsson, all rights reserved.
 */
package org.jample.spring.ws.server;

import java.net.InetAddress;

import org.mortbay.jetty.Server;
import org.mortbay.jetty.webapp.WebAppContext;

/**
 * @author eccicce
 * @version $Revision: $
 * 
 */
public class WSServer {

    public static final int PORT = 18080;

    public static void main(String[] args) throws Exception {
        Server server = new Server(PORT);
        server.setHandler(new WebAppContext("src/main/resources/spring/ws/webapp", "/"));
        server.setStopAtShutdown(true);
        server.start();

        System.out.println("The server is listening on: http://" + InetAddress.getLocalHost().getHostAddress() + ":"
                + PORT);
        System.out.println("Hit Enter in console to stop server");
        if (System.in.read() != 0) {
            System.out.println("Server stopping");
            server.stop();
            System.out.println("Server stopped");
        }
    }
}
